﻿using System;
using MyWeb.Business;

namespace MyWeb.Controls
{
    public partial class u_Partner : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                ShowPartner();
            }
        }
        private void ShowPartner()
        {
            var s = "<div class=\"NewGroupDetail\">\n<div class=\"NewTop1\">\n<div class=\"bizslide\">\n<div id=\"LeftSlide\">\n";
            var list = AdvertiseService.Advertise_GetByTop("", "Active = '1' and Position = '3' ", "");
            if (list.Count > 0)
            {
                foreach (var t in list)
                {
                    s += "<a href=\"" + t.Link + "\" title='" + t.Name + "'><img src='" + t.Images + "' alt = '"+ t.Name +"' /></a>";
                }
            }
            s += "</div></div></div><div class=\"clearn\"></div>\n</div>";
            ltrpartner.Text = s;
        }
    }
}